package com.ecnu.web.controller.PDF;

import com.ecnu.common.core.controller.BaseController;
import com.ecnu.common.core.domain.AjaxResult;
import com.ecnu.common.core.domain.model.LoginUser;
import com.ecnu.system.service.IProjectStageMissionService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.constraints.NotBlank;
import java.io.IOException;

@Api(tags = "奖状地址")
@RestController
@RequestMapping("/merit")
@Validated//用来校验controller参数带@notblack类似的注解
public class WinController extends BaseController {
    @Autowired
    private IProjectStageMissionService stageMissionService;
    @ApiOperation(value = "获取证书地址")
    @GetMapping("/certificate")
    public AjaxResult get(@NotBlank String proId) throws IOException {
        LoginUser loginUser = getLoginUser();
//        LoginUser loginUser = new LoginUser();
        return stageMissionService.getCertificate(proId,loginUser);
    }



}
